<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/WEB-INF/jsp/common/page_head.jsp" %>

<script src="../asset/js/plugins/validate/jquery.validate.min.js" type="text/javascript"></script>
<script src="../asset/js/page/sysmrg/actorUpdate.js" type="text/javascript"></script>

<body class="gray-bg">
<form class="form-horizontal m-t" id="actorUpdateForm" action="updateActor.do" method="POST">
	<div class="col-sm-12">
		<input id="id" name="id" value="${actor.id}" type="hidden">
		<input id="depCode" name="depCode" value="100" type="hidden">
		<div class="ibox float-e-margins">
			<div class="ibox-title">
				<div class="form-group">
					<label class="col-sm-2 control-label">角色名称</label>
					<div class="col-sm-10">
						<input id="actorName" name="actorName" value="${actor.actorName}" class="form-control" >
		    			<span class="help-block m-b-none">
		    				<i class="fa fa-info-circle"></i> 角色名只能由汉字、英文字母和数字组成
		    			</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">备注</label>
					<div class="col-sm-10">
						<input id="summary" name="summary" value="${actor.summary}" class="form-control">
					</div>
				</div>
				<div class="ibox-title">
		            <h5>功能权限</h5>                        
		        </div>
		        <c:forEach var="item" items="${modules}">
		        	<div class="form-group">
		    			<label class="col-sm-2 control-label">${item.name} :</label>
		    			<div class="checkbox">
		    				<div class="col-sm-6">
		    				<c:forEach var="item1" items="${funcs}">
		    					<c:if test="${item1.code > item.code && item1.code < item.code+100}">
		    						<label>
		    						<c:set var="flag" value="${0}"/>
		    						<c:forEach var="item2" items="${actor.funCodes}">
		    							<c:if test="${item2 == item1.code}">
		    								<c:set var="flag" value="${1}"/>
		    								<input type="checkbox" class="checkbox" name="funCodeArrStr" 
		    										value="${item1.code}" checked> ${item1.name}
		    							</c:if>
		    						</c:forEach>
		    						<c:if test="${flag == 0}">
		    							<input type="checkbox" class="checkbox" name="funCodeArrStr" 
		    									value="${item1.code}"> ${item1.name} 
		    						</c:if>
		    						</label>
		    					</c:if>
		    				</c:forEach>
		    				</div>
		    			</div>
		            </div>
		        </c:forEach>
			</div>
		</div>
	</div>
	<div class="layer-btn-class">
		<button id="saveBtn" class="btn btn-primary" type="submit">保存</button>
		<button type="button" class="btn btn-white cancle-btn">取消</button>
	</div>
</form>
</body>